package com.uzai.console.web.uzaichat;

import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import com.github.xiaoymin.knife4j.annotations.ApiSort;
import com.uzai.common.enums.DeviceTypeEnum;
import com.uzai.console.annotation.SystemLogType;
import com.uzai.console.dto.device.DeviceQuery;
import com.uzai.console.dto.uzaichat.kefuclient.KefuClientAddDto;
import com.uzai.console.dto.uzaichat.kefuclient.KefuClientIdDto;
import com.uzai.console.dto.uzaichat.kefuclient.KefuClientQuery;
import com.uzai.console.dto.uzaichat.kefuuser.KefuUserQuery;
import com.uzai.console.enums.OperationTypeEnum;
import com.uzai.console.enums.SystemModelEnum;
import com.uzai.console.service.device.DeviceService;
import com.uzai.console.service.uzaichat.KefuClientService;
import com.uzai.console.service.uzaichat.KefuUserService;
import com.uzai.console.vo.base.SelectKeyVo;
import com.uzai.console.vo.device.DeviceInfoVo;
import com.uzai.console.vo.uzaichat.kefuclient.KefuClientInfoVo;
import com.uzai.console.vo.uzaichat.kefuuser.KefuUserInfoVo;
import com.uzai.console.web.BaseController;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

import java.util.ArrayList;
import java.util.List;

/**
 * @author liuqi
 * @date 2021年08月25日 20:15
 */
@Api(value = "客服管理",tags = "悠聊|客服管理")
@ApiSort(20)
@RestController
public class KefuClientContoller extends BaseController {
    private Logger logger = LoggerFactory.getLogger(KefuClientContoller.class);

    @Autowired
    private KefuClientService kefuClientService;
    @Autowired
    private DeviceService deviceService;
    @Autowired
    private KefuUserService kefuUserService;

//    @ApiOperation(value = "分页查询客服管理列表", notes = "分页查询客服管理列表", response = KefuClientInfoVo.class)
//    @ApiOperationSupport(order = 1)
//    @PostMapping("/kefuClient/findKefuClientList")
//    public Object findKefuClientList(@RequestBody KefuClientQuery kefuClientQuery){
//        return kefuClientService.findKefuClientList(kefuClientQuery);
//    }
//
//    @ApiOperation(value = "分页查询未绑定客服账号的机器人列表", notes = "分页查询未绑定客服账号的机器人列表", response = DeviceInfoVo.class)
//    @ApiOperationSupport(order = 2)
//    @PostMapping("/kefuClient/findDeviceListForUnBindKefuUser")
//    public Object findDeviceListForUnBindKefuUser(@RequestBody DeviceQuery deviceQuery){
//        return deviceService.findDeviceListForUnBindKefuUser(deviceQuery);
//    }
//
//    @SystemLogType(model = SystemModelEnum.WechatUser, type = OperationTypeEnum.UPDATE)
//    @ApiOperation(value = "添加客服管理", notes = "添加客服管理")
//    @ApiOperationSupport(order = 4)
//    @PostMapping("/kefuClient/addKefuClient")
//    public Object addKefuClient(@RequestBody KefuClientAddDto kefuClientAddDto){
//        kefuClientService.addKefuClient(kefuClientAddDto);
//        return true;
//    }
//
//    @ApiOperation(value = "删除客服管理", notes = "删除客服管理")
//    @ApiOperationSupport(order = 5)
//    @PostMapping("/kefuClient/deleteKefuClient")
//    public Object deleteKefuClient(@RequestBody KefuClientIdDto kefuClientIdDto){
//        kefuClientService.deleteKefuClient(kefuClientIdDto);
//        return true;
//    }

//
//
//    @ApiOperation(value = "分页查询客服账号列表", notes = "分页查询客服账号列表", response = KefuUserInfoVo.class)
//    @ApiOperationSupport(order = 3)
//    @PostMapping("/kefuClient/findKefuUserList")
//    public Object findKefuUserList(@RequestBody KefuUserQuery kefuUserQuery){
//        return kefuUserService.findKefuUserList(kefuUserQuery);
//    }
//
//
//
//    @ApiOperation(value = "查询设备类型下拉列表框列表", notes = "查询设备类型下拉列表框列表", response = SelectKeyVo.class)
//    @ApiOperationSupport(order = 6)
//    @PostMapping("/kefuClient/findDeviceTypeSelect")
//    public Object findDeviceTypeSelect(){
//        List<SelectKeyVo> selectIdVoList = new ArrayList<>();
//        DeviceTypeEnum[] deviceTypeEnumArr = DeviceTypeEnum.values();
//        if(deviceTypeEnumArr != null && deviceTypeEnumArr.length > 0){
//
//            SelectKeyVo selectKeyVo_private =  new SelectKeyVo();
//            selectKeyVo_private.setKey(DeviceTypeEnum.DT_PC_WECHAT.getKey());
//            //页面显示
//            selectKeyVo_private.setValue("个人微信");
//            selectIdVoList.add(selectKeyVo_private);
//
//            for(DeviceTypeEnum deviceTypeEnum : deviceTypeEnumArr){
//                //个人微信剔除
//                if(!DeviceTypeEnum.DT_PC_WECHAT.getKey().equals(deviceTypeEnum.getKey())){
//                    SelectKeyVo selectKeyVo =  new SelectKeyVo();
//                    selectKeyVo.setKey(String.valueOf(deviceTypeEnum.getKey()));
//                    //页面显示
//                    selectKeyVo.setValue(deviceTypeEnum.getDesc());
//                    selectIdVoList.add(selectKeyVo);
//                }
//            }
//        }
//        return selectIdVoList;
//    }

}
